<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      * {
        margin: 0;
      }
      /* 
        1 repeat
        可以设置row/column的尺寸
        repeat(3, 100px)
        2 minmax
        可以设置一行或者一列的最大最小值范围，从而实现响应式布局
      */
      .main {
        height: 300px;
        background-color: aqua;
        display: grid;
        /* 设置多少列以及列的宽度 */
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        /* 设置多少行以及行的高度 */
        /* grid-template-rows: repeat(3, 80px); */
        grid-auto-rows: 100px;
      }
      .main div {
        /* width: 50px;
        height: 50px; */
        border: 1px solid black;
        box-sizing: border-box;
      }
      .main div:nth-of-type(1) {
        /* grid-column-start: 2;
        grid-column-end: 4;
        grid-row-start: 2;
        grid-row-end: 3; */
        /* justify-self: end;
        align-self: center; */
        /* grid-row: 2 / 3;
        grid-column: 2 / 3; */
      }
    </style>
  </head>
  <body>
    <div class="main">
      <div>1</div>
      <div>2</div>
      <div>3</div>
      <div>4</div>
      <div>5</div>
      <div>6</div>
      <div>7</div>
      <div>8</div>
      <div>9</div>
    </div>
  </body>
</html>
